package com.example.mydefinedview1.ui

import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Path
import android.util.AttributeSet
import android.view.View

/**
 *
 * @Author： LJH
 * @Time： 2022/6/29
 * @description：
 */
class PathView(context: Context, attr:AttributeSet?):View(context,attr) {
    private val paint = Paint()
    private val path = Path()

    override fun onDraw(canvas: Canvas?) {
        super.onDraw(canvas)
        paint.style = Paint.Style.FILL
        path.addArc(200F,200F,400F,400F,-225F,225F)
        path.arcTo(400F,200F,600F,400F,-180F,225F,false)
        path.lineTo(400F,542F)
        canvas?.drawPath(path,paint)
    }
}